<template>
  <div class="yshow-nav">
    <div class="yshow-nav-img">
      <img src="../../assets/yanchulogo.png" alt="" />
      <span class="el-icon-location-outline">西安</span>
      <span class="el-icon-arrow-down"></span>
    </div>
    <div class="yshow-nav-search">
      <div>
        <input type="text" v-model="search"  @keyup.13="enterKey" placeholder="请输入演出信息" />
      </div>
      <span class="el-icon-search icon-s" @click="searchs()"></span>
      <span>微信扫码购票</span>
      <div class="buy-piao">
        <img src="../../assets/buypiao.jpg" alt="二维码" />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Yshownav",
  data() {
    return {
      search: "",
    };
  },
  mounted() {},
  methods: {
    searchs() {
      // 跳转搜索页，传搜索值
      let urls =  this.$router.resolve({path:'/ySearch',query:{datas:this.search}})
      window.open(urls.href,'_black')
      this.search = ''
    },
    // 回车搜索
    enterKey(){
      // 跳转搜索页，传搜索值
      let urls =  this.$router.resolve({path:'/ySearch',query:{datas:this.search}})
      window.open(urls.href,'_black')
      this.search = ''
    }
  },
};
</script>

<style lang="scss" scoped>
.yshow-nav {
  position: fixed;
  z-index: 99;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: #ee4137;
  padding: 0 150px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  .yshow-nav-img {
    height: 60px;
    display: flex;
    align-items: center;
    cursor: pointer;
    img {
      width: 266px;
      height: 35px;
      margin-right: 35px;
    }
    span {
      color: #fff;
      padding: 0 5px 0 0;
    }
  }

  .yshow-nav-search {
    height: 60px;
    display: flex;
    align-items: center;
    position: relative;
    .buy-piao:hover img {
      display: block;
    }
    .buy-piao {
      width: 100px;
      height: 50px;
      position: absolute;
      top: 0px;
      right: -10px;
      img {
        position: absolute;
        top: 50px;
        right: 0px;
        display: none;
        width: 100px;
      }
    }
    .icon-s {
      font-size: 20px;
      color: #fff;
      margin-right: 10px;
      cursor: pointer;
    }
    span {
      color: #fff;
      margin-left: 10px;
      font-size: 14px;
      cursor: pointer;
    }
    div {
      height: 35px;
      input {
        box-sizing: border-box;
        height: 100%;
        list-style: none;
        outline: none;
        border: none;
        border-radius: 20px;
        background: rgba(252, 248, 248, 0.2);
        padding: 0 10px;
        color: rgb(255, 255, 255);
      }
    }
  }
}
</style>
